package com.platform.hjt.from.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.platform.hjt.crm.model.CrmCustomerInfo;
import com.platform.hjt.sys.model.SysCompanyInfo;
import com.platform.hjt.sys.model.SysUserInfo;

/**
 * FromQjOrder entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "from_qj_order")
public class FromQjOrder implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3337041800130791770L;
	private String qjOrderId;
	private SysCompanyInfo sysCompanyInfo;
	private SysUserInfo sysUserInfo;
	private CrmCustomerInfo crmCustomerInfo;
	private Double orderTotalPrice;
	private String orderCode;
	private String remark;
	private Timestamp createTime;
	private Boolean isDel;
	private String processId;
	private String processOrderId;
	
	private Double auditingTotalPrice;
	
	private String payType;
	
	private Set<FromQjOrderDetail> fromQjOrderDetails = new HashSet<FromQjOrderDetail>(
			0);

	// Constructors

	/** default constructor */
	public FromQjOrder() {
	}

	/** minimal constructor */
	public FromQjOrder(String qjOrderId) {
		this.qjOrderId = qjOrderId;
	}

	/** full constructor */
	public FromQjOrder(String qjOrderId, SysCompanyInfo sysCompanyInfo,
			SysUserInfo sysUserInfo, CrmCustomerInfo crmCustomerInfo,
			Double orderTotalPrice, String orderCode, String remark,
			Timestamp createTime, Boolean isDel, String processId,
			String processOrderId, Set<FromQjOrderDetail> fromQjOrderDetails) {
		this.qjOrderId = qjOrderId;
		this.sysCompanyInfo = sysCompanyInfo;
		this.sysUserInfo = sysUserInfo;
		this.crmCustomerInfo = crmCustomerInfo;
		this.orderTotalPrice = orderTotalPrice;
		this.orderCode = orderCode;
		this.remark = remark;
		this.createTime = createTime;
		this.isDel = isDel;
		this.processId = processId;
		this.processOrderId = processOrderId;
		this.fromQjOrderDetails = fromQjOrderDetails;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="systemUUID",strategy="uuid")
	@GeneratedValue(generator="systemUUID")
	@Column(name = "qj_order_id", unique = true, nullable = false, length = 32)
	public String getQjOrderId() {
		return this.qjOrderId;
	}

	public void setQjOrderId(String qjOrderId) {
		this.qjOrderId = qjOrderId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_company_info_id")
	public SysCompanyInfo getSysCompanyInfo() {
		return this.sysCompanyInfo;
	}

	public void setSysCompanyInfo(SysCompanyInfo sysCompanyInfo) {
		this.sysCompanyInfo = sysCompanyInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sys_user_info_id")
	public SysUserInfo getSysUserInfo() {
		return this.sysUserInfo;
	}

	public void setSysUserInfo(SysUserInfo sysUserInfo) {
		this.sysUserInfo = sysUserInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "crm_customer_info_id")
	public CrmCustomerInfo getCrmCustomerInfo() {
		return this.crmCustomerInfo;
	}

	public void setCrmCustomerInfo(CrmCustomerInfo crmCustomerInfo) {
		this.crmCustomerInfo = crmCustomerInfo;
	}

	@Column(name = "order_total_price", precision = 22, scale = 0)
	public Double getOrderTotalPrice() {
		return this.orderTotalPrice;
	}

	public void setOrderTotalPrice(Double orderTotalPrice) {
		this.orderTotalPrice = orderTotalPrice;
	}

	@Column(name = "order_code", length = 100)
	public String getOrderCode() {
		return this.orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}

	@Column(name = "remark", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "is_del")
	public Boolean getIsDel() {
		return this.isDel;
	}

	public void setIsDel(Boolean isDel) {
		this.isDel = isDel;
	}

	@Column(name = "process_id", length = 32)
	public String getProcessId() {
		return this.processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	@Column(name = "process_order_id", length = 32)
	public String getProcessOrderId() {
		return this.processOrderId;
	}

	public void setProcessOrderId(String processOrderId) {
		this.processOrderId = processOrderId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fromQjOrder")
	public Set<FromQjOrderDetail> getFromQjOrderDetails() {
		return this.fromQjOrderDetails;
	}

	public void setFromQjOrderDetails(Set<FromQjOrderDetail> fromQjOrderDetails) {
		this.fromQjOrderDetails = fromQjOrderDetails;
	}
	
	@Column(name = "auditing_total_price")
	public Double getAuditingTotalPrice() {
		return auditingTotalPrice;
	}

	public void setAuditingTotalPrice(Double auditingTotalPrice) {
		this.auditingTotalPrice = auditingTotalPrice;
	}

	@Column(name = "pay_type")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

}